package com.itheima;

public class Test9 {
    public static void main(String[] args) {
        //打印三角形
        int n =5;
        for (int i = 1; i <=n ; i++) {
            //打印空格
            for (int j = 1; j <=(n-i) ; j++) {
                System.out.print(" ");
            }
            //打印星号
            for (int j = 1; j <=(2*i-1) ; j++) {
                System.out.print(j%2==0?" ":"*");
            }
            System.out.println();
    }
}
}
